|
|
|
|
|
|
|
after the DateClicked event is finished processing. Besides the Value property that you can use anywhere in the application, the control has several other properties that return specific date information: |
|
|
|
|
|
|
|
|
MonthReturns a value (112) of the month containing the currently selected date. |
|
|
|
|
|
|
|
|
DayReturns the day number (131) currently selected. |
|
|
|
|
|
|
|
|
DayOfWeekIndicates the day of the week the selected date falls on. |
|
|
|
|
|
|
|
|
YearReturns the year of the selected date. |
|
|
|
|
|
|
|
|
WeekReturns the week number the selected date falls in. |
|
|
|
|
|
|
|
|
If your application requires the user to enter a date range, you can use the MonthView control to display or select a date range. In order to allow the selection of more than one date, the MultiSelect property must be set to True. In addition, you can control the maximum number of days that can be selected using the MaxSelCount property (the default being seven days). The SelStart and SelEnd properties will contain the starting and ending dates in a range. However, if only one date is selected, both properties will contain the same date. When a range of dates is selected, they will all be highlighted (see Figure 15.10). |
|
|
|
|
|
|
|
|
Figure 15.10.
Selecting a date range will highlight all
of the selected dates on the control. |
|
|
|
|
|
|
|
|
Displaying Multiple Months |
|
|
|
|
|
|
|
|
To display more than one month on the control, you would use the MonthRows and MonthColumns properties. These are used to specify how many months will be displayed. To display six months, set the MonthRows property to 2 and the MonthColumns property to 3. The resulting display would resemble the one in Figure 15.11. |
|
|
|
|
|